<template>
  <el-empty :image-size="400">
    <el-button type="primary" @click="go('back')">返回上一级</el-button>
    <el-button type="primary"  @click="go('home')">返回主页</el-button>
  </el-empty>
</template>

<script>
import { useRouter } from 'vue-router'


export default {
  name: 'Notfound',
  setup() {
    const router = useRouter()
    const go=(url)=>{
      console.log(url);
      if (url === 'back') {
        router.back()
      }else{
        router.push('index')
      }
      
    }

    onMounted(() => {
      if (localStorage.getItem('token')) {
        router.push('login')
      }
    })

    return {
      go
    }
  }
}
</script>

<style scoped>
  
</style>
